package BankManageSystem;

import java.util.Scanner;

public class Operation {
    Account loginAccount = new Account();
    Scanner sc = new Scanner(System.in);


    public void show(){
       isFlag: while (true) {
            System.out.println("请选择你需要的业务");
            System.out.println("1.存款");
            System.out.println("2.取款");
            System.out.println("3.修改密码");
            System.out.println("4.查询余额");
            System.out.println("5.退出登录");
            int choose = sc.nextInt();
            switch (choose){
                case 1:
                    //存款
                    System.out.println("请输入你要存款的金额：");
                    double money1 = sc.nextDouble();
                    loginAccount.deposit(money1);
                    break;
                case 2:
                    //取款
                    System.out.println("请输入你要取款的金额：");
                    double money2 = sc.nextDouble();
                    loginAccount.withdrawal(money2);
                    break;
                case 3:
                    //修改密码
                    System.out.println("请输入你的新密码：");
                    int password = sc.nextInt();
                    loginAccount.changePassword(password);
                    break;
                case 4:
                    //查询余额
                    System.out.println("你的账户余额为："+loginAccount.queryBalance());
                    break;
                case 5:
                    //退出登录
                    break isFlag;
                default:
                    System.out.println("输入有误，请重新输入");
            }
        }
    }
}
